//
//  SubjectImageTableViewCell.m
//  Journey
//
//  Created by dllo on 16/5/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SubjectImageTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation SubjectImageTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

-(void)createSubviews
{
    self.photo = [[UIImageView alloc] init];
    self.photo.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.photo];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.photo.frame = CGRectMake(10 * WIDTHC, 10 * WIDTHC, self.contentView.frame.size.width - 20, self.contentView.frame.size.height - 10);
}


-(void)setSubModel:(SubjectModel *)subModel
{
    _subModel = subModel;
    [self.photo sd_setImageWithURL:[NSURL URLWithString:_subModel.photo] placeholderImage:[UIImage imageNamed:@"image1"]];
}

@end
